package cn.edu.scau.cmi.liguanwu.singleton;
import java.net.URL;
import java.util.ResourceBundle;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
public class Controller implements Initializable{
	private static String nam;
	@FXML
	private Button button;
	@FXML
	private TextField textfield;
	@FXML
	private Label label;
	@FXML
	private Label label1;
	@Override
	public void initialize(URL location, ResourceBundle resources) {
	}
	public void onClick(ActionEvent event) {
		String name = textfield.getText();
		if(name == null) {
			label.setText("failed");
		    return ;
		}
		if(Chairman.getInstance(name)) {
			label.setText(name+Chairman.getchairman().toString());
			this.nam=name;
		}
		else {
			label1.setText(nam+Chairman.getchairman().toString());
		}
	}
	

}